<template>
    <div style="height:100%">
        <!-- 面包屑 -->
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>权限管理</el-breadcrumb-item>
            <el-breadcrumb-item>权限列表</el-breadcrumb-item>
        </el-breadcrumb>
        <br>

        <!-- 面包屑 -->
        <!-- 卡片 -->
        <el-card>
            <el-table :data="rightslist">
                <el-table-column
                    type="index"
                    label="#"
                ></el-table-column>
                <el-table-column
                    prop="authName"
                    label="商品管理"
                ></el-table-column>
                <el-table-column
                    label="路径"
                    prop="path"
                ></el-table-column>
                <el-table-column label="权限等级">
                    <template slot-scope="scope">
                        <div>
                            <el-tag v-show="scope.row.level==0">{{scope.row.level|levels}}</el-tag>
                            <el-tag
                                type="success"
                                v-show="scope.row.level==1"
                            >{{scope.row.level|levels}}</el-tag>
                            <el-tag
                                type="danger"
                                v-show="scope.row.level==2"
                            >{{scope.row.level|levels}}</el-tag>
                        </div>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
        <!-- 卡片 -->
    </div>
</template>

<script>
export default {
  data() {
    return {
      rightslist: []
    };
  },
  mounted() {
    this.xr();
  },
  methods: {
    async xr() {
      let res = await this.$API.RightList();
      console.log("权限列表", res);
      this.rightslist = res;
    }
  }
};
</script>

<style scoped >
</style>
